package com.itxx.keyCase.demo1;
import java.util.TreeSet;

//自然排序
public class Test1 {
    public static void main(String[] args) {
        TreeSet<Student> treeSet = new TreeSet<>();

        treeSet.add(new Student("张三", 27, 99));
        treeSet.add(new Student("李四", 23, 60));
        treeSet.add(new Student("王五", 27, 99));
        treeSet.add(new Student("赵六", 16, 88));
        treeSet.add(new Student("李元霸", 5, 99));

        for (Student student : treeSet) {
            System.out.println(student);
        }
    }
}
